package com.kuzlak.cms.constant;

import java.util.HashMap;
import java.util.Map;

public class ResultConstant {

    public static final int SUCSESS = 200;
    public static final int EMPTIY = 204;
    public static final int TOKEN = 402;
    public static final int ON_STATUS = 403;
    public static final int EMPTY_DATA = 404;
    public static final int EMPTY_DATA_REP = 405;
    public static final int EMPTY_DATA_REP_INFO = 406;
    public static final int FAIL = 501;
    public static final int AUTH = 203;

    public static String get(int code) {


        Map<Integer, String> map = new HashMap<Integer, String>();
        map.put(SUCSESS, "成功 ");
        map.put(EMPTIY, "参数值错误 ");
        map.put(TOKEN, "令牌失败（Token）");
        map.put(EMPTY_DATA, "数据为空");
        map.put(EMPTY_DATA_REP, "数据重复");
        map.put(AUTH, "没有权限");
        map.put(FAIL, "异常错误");
        map.put(EMPTY_DATA_REP_INFO, "客户名称已存在，请修改新的客户名称");
        map.put(ON_STATUS, "");

        return map.containsKey(code) ? map.get(code) : map.get(501);
    }

}
